<template>
  <div class="infos">
    <div class="houseName">
      {{ infosData.houseName }}
    </div>
    <div class="houseTags">
      <template v-for="(item, index) of infosData.houseTags" :key="index">
        <span
          class="tagItem"
          v-if="item.tagText"
          :style="{
            color: item.tagText.color,
            background: item.tagText.background.color,
          }"
        >
          {{ item.tagText.text }}
        </span>
      </template>
    </div>
    <div class="commentBrief">
      <div class="left">
        <span class="overall">{{ infosData.commentBrief.overall }}</span>
        <span class="scoreTitle">{{ infosData.commentBrief.scoreTitle }}</span>
        <span class="conment">{{ infosData.commentBrief.commentBrief }}</span>
      </div>
      <div class="right">
        <span class="totalCount">
          {{ infosData.commentBrief.totalCount }}条评论
        </span>
        <van-icon name="arrow" />
      </div>
    </div>
    <div class="nearByPosition">
      <span class="address">
        {{ infosData.nearByPosition.address }}
      </span>
      <span class="surround">
        <span class="text"> 地图周边 </span>
        <van-icon name="arrow" />
      </span>
    </div>
  </div>
</template>

<script setup>
const propo = defineProps({
  infosData: {
    type: Object,
    default: () => ({}),
  },
});
</script>

<style lang="less" scoped>
.infos {
  padding: 10px;
  background-color: #fff;
  .houseName {
    font-weight: 700;
    font-size: 20px;
    color: #333;
    text-align: justify;
    line-height: 24px;
    overflow: hidden;
    margin-bottom: 6px;
  }
  .houseTags {
    display: flex;
    flex-wrap: wrap;
    .tagItem {
      padding: 2px 4px;
      margin: 4px;
    }
  }
  .commentBrief {
    display: flex;
    justify-content: space-between;
    height: 30px;
    width: 100%;
    line-height: 30px;
    background-color: #f5f7fa;
    margin: 8px 0;
    padding: 0 4px;
    .left {
      height: 30px;
      .overall {
        color: #333;
        z-index: 10;
        font-weight: 700;
        font-size: 18px;
        margin-right: 2px;
      }
      .scoreTitle {
        margin-right: 4px;
        font-size: 12px;
        color: #333;
        font-weight: 700;
        margin: 0px 4px;
      }
      .conment {
        color: #666;
        white-space: nowrap;
        letter-spacing: 0;
        font-size: 12px;
        line-height: 14px;
      }
    }
    .right {
      height: 30px;
      color: var(--color);
    }
  }
  .nearByPosition {
    display: flex;
    justify-content: space-between;
    background-color: #f5f7fa;
    height: 30px;
    width: 100%;
    line-height: 30px;
    padding: 0 4px;
    .address {
      font-weight: 700;
      font-size: 14px;
      color: #333;
      line-height: 30px;
      -o-text-overflow: ellipsis;
      text-overflow: ellipsis;
      overflow: hidden;
      white-space: nowrap;
    }
    .surround {
      color: var(--color);
    }
  }
}
</style>
